import ElementPlus from 'element-plus';
import 'microconnect-common/styles/index.scss';
import 'uno.css';
import { createApp } from 'vue';
import App from './App.vue';
import Router from './router';
import store from './store';
// 注册svg插件
import * as Sentry from '@sentry/vue';
import 'element-plus/dist/index.css';
import 'element-plus/es/components/loading/style/index';
import 'element-plus/theme-chalk/display.css'; // 引入基于断点的隐藏类
import 'normalize.css';
import 'virtual:svg-icons-register';
// import { initKeycloak } from './keycloak';
import './styles/index.scss';
// import { setupSentry } from './sentry/index';

// 在挂载节点之前需要先使用store保存kc登录信息，所以先挂载store实例
const app = createApp(App).use(store);

// initKeycloak(() => {
  Sentry.init({
    app,
    enabled: false,
    release: 'decision-engine@1.0.0',
    environment: import.meta.env.MODE,
    autoSessionTracking: true,
    dsn: 'https://112bff60e24900663bf1efc708fab295@dev-sentry.mcisaas.com/33',
    integrations: [
      new Sentry.BrowserTracing({
        // Set 'tracePropagationTargets' to control for which URLs distributed tracing should be enabled
        tracePropagationTargets: ['localhost', /^https:\/\/dc-dev1\.mcisaas\.com/],
        routingInstrumentation: Sentry.vueRouterInstrumentation(Router)
      }),
      new Sentry.Replay()
    ],
    // Performance Monitoring
    tracesSampleRate: 1.0, // Capture 100% of the transactions
    // Session Replay
    replaysSessionSampleRate: 0.2, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production.
    replaysOnErrorSampleRate: 1.0 // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur.
  });
  app.use(Router).use(ElementPlus);
  app.mount('#app');
// });
